<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>即时分析</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="./css/header.css" rel="stylesheet" type="text/css"/>
	<style type="text/css">
	#btn{display:block;width:100px;margin-left:200px;height:52px; line-height:52px; text-align:center; font-family:arial,verdana,sans-serif, '新宋体'; font-weight:bold; font-size:22px; background:#428bca;color:#fff; text-decoration:none; border: 3px solid #357ebd; cursor:pointer}
    #btn:hover{background:#1165ae;}
    #btn:active{background:#0d79d5;}
	</style>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script src="js/highcharts.js"></script>
	<script src="js/exporting.js"></script>
	
	<script type="text/javascript">
  $(function(){
	  $('#btn').click(function() {
	          $.ajax({
	        	  type: "POST",
	              dataType: "JSON",
	              url:"servlet/Single",
	              data: $('#txta').serialize(),
	              success: function (data) {
	            	  $('#txtResult').val(data.sResult);
	            	  $('#container').highcharts({
	            	        title: {
	            	            text: '单条文本情感值',
	            	            x: -20 //center
	            	        },
	            	        subtitle: {
	            	            text: '(折线图)',
	            	            x: -20
	            	        },
	            	        xAxis: {
	            	            categories: ["厌恶","悲伤","愤怒","高兴","喜好","恐惧","惊讶"]
	            	                
	            	        },
	            	        yAxis: {
	            	            title: {
	            	                text: '情感值'
	            	            },
	            	            plotLines: [{
	            	                value: 0,
	            	                width: 1,
	            	                color: '#808080'
	            	            }]
	            	        },
	            	        legend:{
	            	        	enabled:false
	            	        },
	            	        series:[
	            	                {
	            	                 name:'情感值',
	            	                 data:data.series
	            	                	
	            	                }
	            	                ],
	            	        credits:{
	            	        	enabled:false
	            	        }
	            	    });   	 
	  }
  });
	  });
	  });
 
  </script>
  
  </head>
  
  <body>
  
<div id="header">
        <div class="logdo" style=“weight="150px";float:left;padding-left:10px;”>
			<a href="./index.jsp">
				<img src="./img/logo.png">
			</a>
		</div>
        <div id="nav">
            <ul class="menu">
                <li class="current"><a href="./index.jsp">首页</a></li>
                <li><a href="./spline.jsp">在线分析</a>
                  <ul>
                  <li><a href="./spline.jsp">曲线图</a></li>
                  <li><a href="./pie.jsp">饼状图</a></li>
                  <li><a href="./hourlyline.jsp">时序图</a></li>
                  <li><a href="./weeklycolumn.jsp">周序图</a></li>
                  </ul> 
                  </li>
                <li><a href="./single.jsp">即时分析</a><span class="lines"></span></li>           
                <li><a href="./offline.jsp">离线分析</a><span class="lines"></span></li>
            </ul>
        </div>
</div>

<div id="main" >
  
    <div id=“txt” style="float:left;margin-top:20px;margin-left:80px;weight:300px;height:520px;border:1px solid #ccc">
     <div id="search" style="border-bottom:1px solid #ccc" >
     <textarea rows="5" cols="60" name="txta" id="txta" style="color:#999999;font-size:18px;resize:none"
      onKeyDown="textdown(event)"
      onKeyUp="textup()" onfocus="if(value=='请输入要分析的单条微博（限140字）'){value=''}"
      onblur="if (value ==''){value='请输入要分析的单条微博（限140字）'}">请输入要分析的单条微博（限140字）</textarea>
     <input id="btn" class="button" type="button" value="提交">
     </div>
     
     <div id="result">
     	<h3>分词结果：</h3>
     	<textarea rows="15" cols="69" id="txtResult" style="resize:none"></textarea>
     </div>
    </div>

   <div id="container" style="weight:600px;height:520px;float:right;margin-top:20px;margin-right:80px;"></div>
   
</div>
  </body>
</html>
